\(\int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx\) [188]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F(-2)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 60 \[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {2 i a \sqrt {e \sec (c+d x)}}{d}+\frac {2 a \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {e \sec (c+d x)}}{d} \]

[Out]

2*I*a*(e*sec(d*x+c))^(1/2)/d+2*a*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticF(sin(1/2*d*x+1/2*c),
2^(1/2))*cos(d*x+c)^(1/2)*(e*sec(d*x+c))^(1/2)/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3567, 3856, 2720} \[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {2 a \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {e \sec (c+d x)}}{d}+\frac {2 i a \sqrt {e \sec (c+d x)}}{d} \]

[In]

Int[Sqrt[e*Sec[c + d*x]]*(a + I*a*Tan[c + d*x]),x]

[Out]

((2*I)*a*Sqrt[e*Sec[c + d*x]])/d + (2*a*Sqrt[Cos[c + d*x]]*EllipticF[(c + d*x)/2, 2]*Sqrt[e*Sec[c + d*x]])/d

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rubi steps \begin{align*} \text {integral}& = \frac {2 i a \sqrt {e \sec (c+d x)}}{d}+a \int \sqrt {e \sec (c+d x)} \, dx \\ & = \frac {2 i a \sqrt {e \sec (c+d x)}}{d}+\left (a \sqrt {\cos (c+d x)} \sqrt {e \sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 i a \sqrt {e \sec (c+d x)}}{d}+\frac {2 a \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {e \sec (c+d x)}}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.59 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.73 \[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {2 a \left (i+\sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )\right ) \sqrt {e \sec (c+d x)}}{d} \]

[In]

Integrate[Sqrt[e*Sec[c + d*x]]*(a + I*a*Tan[c + d*x]),x]

[Out]

(2*a*(I + Sqrt[Cos[c + d*x]]*EllipticF[(c + d*x)/2, 2])*Sqrt[e*Sec[c + d*x]])/d

Maple [A] (verified)

Time = 7.39 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.60

method result size
parts \(-\frac {2 i a \left (\cos \left (d x +c \right )+1\right ) \sqrt {e \sec \left (d x +c \right )}\, \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, F\left (i \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right ), i\right )}{d}+\frac {2 i a \sqrt {e \sec \left (d x +c \right )}}{d}\) \(96\)
default \(-\frac {2 i a \left (F\left (i \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )+F\left (i \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-1\right ) \sqrt {e \sec \left (d x +c \right )}}{d}\) \(132\)

[In]

int((e*sec(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-2*I*a/d*(cos(d*x+c)+1)*(e*sec(d*x+c))^(1/2)*(1/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*Ellipt
icF(I*(csc(d*x+c)-cot(d*x+c)),I)+2*I*a*(e*sec(d*x+c))^(1/2)/d

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.07 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.98 \[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=-\frac {2 \, {\left (-i \, \sqrt {2} a \sqrt {\frac {e}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} e^{\left (\frac {1}{2} i \, d x + \frac {1}{2} i \, c\right )} + i \, \sqrt {2} a \sqrt {e} {\rm weierstrassPInverse}\left (-4, 0, e^{\left (i \, d x + i \, c\right )}\right )\right )}}{d} \]

[In]

integrate((e*sec(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

-2*(-I*sqrt(2)*a*sqrt(e/(e^(2*I*d*x + 2*I*c) + 1))*e^(1/2*I*d*x + 1/2*I*c) + I*sqrt(2)*a*sqrt(e)*weierstrassPI
nverse(-4, 0, e^(I*d*x + I*c)))/d

Sympy [F]

\[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=i a \left (\int \left (- i \sqrt {e \sec {\left (c + d x \right )}}\right )\, dx + \int \sqrt {e \sec {\left (c + d x \right )}} \tan {\left (c + d x \right )}\, dx\right ) \]

[In]

integrate((e*sec(d*x+c))**(1/2)*(a+I*a*tan(d*x+c)),x)

[Out]

I*a*(Integral(-I*sqrt(e*sec(c + d*x)), x) + Integral(sqrt(e*sec(c + d*x))*tan(c + d*x), x))

Maxima [F]

\[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=\int { \sqrt {e \sec \left (d x + c\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )} \,d x } \]

[In]

integrate((e*sec(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

integrate(sqrt(e*sec(d*x + c))*(I*a*tan(d*x + c) + a), x)

Giac [F(-2)]

Exception generated. \[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=\text {Exception raised: TypeError} \]

[In]

integrate((e*sec(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Unable to divide, perhaps due to rounding error%%%{-1,[2,0]%%%}+%%%{%%{[-2,0]:[1,0,%%%{1,[1]%%%}]%%},[1,0]%
%%}+%%%{%%%

Mupad [B] (verification not implemented)

Time = 4.52 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.67 \[ \int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {2\,a\,\left (\sqrt {\cos \left (c+d\,x\right )}\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )+1{}\mathrm {i}\right )\,\sqrt {\frac {e}{\cos \left (c+d\,x\right )}}}{d} \]

[In]

int((e/cos(c + d*x))^(1/2)*(a + a*tan(c + d*x)*1i),x)

[Out]

(2*a*(cos(c + d*x)^(1/2)*ellipticF(c/2 + (d*x)/2, 2) + 1i)*(e/cos(c + d*x))^(1/2))/d